<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><!DOCTYPE html>
        <html>
        <head>
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>发票管理</title>
            <link rel="shortcut icon" href="favicon.ico">
            <link href="__PUBLIC__/Theme1/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/plugins/iCheck/custom.css" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/animate.min.css" rel="stylesheet">
            <link href="__PUBLIC__/Theme1/css/style.min.css?v=4.1.0" rel="stylesheet">
            <link href="__PUBLIC__/Plugin/style/css/ace.min.css" rel="stylesheet">
        </head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>发票列表</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>

                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>

                    <div class="ibox-content">
                        <form method="post" action="__CONTROLLER__/index" class="form-horizontal"
                              enctype="multipart/form-data">
                            <div class="form-group">
                                <button id="btn" class="btn btn-white" type="submit">搜索</button>
                                <div class="col-sm-2">
                                    <select class="form-control" name="invoiceStatus" size="1">
                                        <option value="-1" <if condition="$invoiceStatus eq -1">selected</if>>全部</option>
                                        <option value="0" <if condition="$invoiceStatus eq 0"> selected</if>>申请中</option>
                                        <option value="1" <if condition="$invoiceStatus eq 1"> selected</if>>已开票</option>
                                    </select>
                                </div>
                                <div class="col-sm-2">
                                    <input class="form-control" name="start_time" id="startDate" class="Wdate"
                                           type="date" onclick="startDateClick()" value="{$start_time}"/>
                                </div>

                                <div class="col-sm-2">
                                    <input class="form-control" name="end_time" id="endDate" class="Wdate" type="date"
                                           onclick="endDateClick()" value="{$end_time}"/>
                                </div>
                            </div>
                        </form>

                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr>
                                <th>发票ID</th>
                                <th>店铺名称</th>
                                <th>用户名</th>
                                <th>发票类型</th>
                                <th>发票抬头类型</th>
                                <th>开票金额</th>
                                <th>发票抬头</th>
                                <th>发票内容</th>
                                <th>发票税率</th>
                                <th>纳税人识别号</th>
                                <th>是否电子发票</th>
                                <th>发票状态</th>
                                <th>创建时间</th>
                                <th>开票时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="result" id="result">
                                <tr>
                                    <td>{$result.invoice_id}</td>
                                    <td>{$result.store_name}</td>
                                    <td>{$result.username}</td>
                                    <td>{$result.invoice_type}</td>
                                    <td>
                                        <if condition="($result.invoice_title_type eq 1)">
                                            个人
                                            <else/>
                                            企业
                                        </if>
                                    </td>
                                    <td>{$result.invoice_money}</td>
                                    <td>{$result.invoice_title}</td>
                                    <td>{$result.invoice_content}</td>
                                    <td>{$result.invoice_rate}</td>
                                    <td>{$result.taxpayer}</td>
                                    <td>
                                        <if condition="($result.is_einvoice eq 0)">
                                           否
                                        </if>
                                        <if condition="($result.is_einvoice eq 1)">
                                            是
                                        </if>

                                    </td>
                                    <td>
                                        <if condition="($result.status eq 0)">
                                           申请中
                                        </if>
                                        <if condition="($result.status eq 1)">
                                            已开票
                                        </if>

                                    </td>
                                    <td>{$result.create_time|date="Y-m-d H:i:s",###}</td>
                                    <td>
                                        <if condition="($result.atime neq null)">
                                            {$result.atime|date="Y-m-d H:i:s",###}
                                        </if>
                                    </td>
                                    <td>
                                        <a title="编辑" href="{:U('Admin/Invoice/edit',array('id'=>$result['invoice_id']))}"><i class="glyphicon glyphicon-pencil" style="margin-right: 10px;"></i></a>
                                        <a title="删除" href="{:U('Admin/Invoice/del',array('id'=>$result['invoice_id']))}"><i class="glyphicon glyphicon-remove"></i></a>
                                        <if condition="($result.status eq 1)">
                                            <a title="详情" href="{:U('Admin/Invoice/detail',array('id'=>$result['invoice_id']))}">详情</a>
                                        </if>
                                        <if condition="($result.status eq 0)">
                                            <a title="去开票" href="{:U('Admin/Invoice/makeInvoice',array('id'=>$result['invoice_id']))}">去开票</a>
                                        </if>
                                    </td>
                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="pagination" style="margin:0px;">
                            {$page}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="__PUBLIC__/Theme1/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/Theme1/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/Theme1/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/Theme1/js/plugins/iCheck/icheck.min.js"></script>
<script>
    $(document).ready(function () {
        $(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
    });
</script>
</body>
</html>
</title>
</head>
<body>

</body>
</html>